<?php session_start();

include_once('../../../config.inc');
require_once(ROOT.'/database/manage_open_api.php');

require_once("../sina/sina_api.php");
require_once("../tencent/tencent_api.php");
require_once("../sohu/sohu_api.php");
require_once("../netease/netease_api.php");

$all = manage_get_all_open_login();

if (isset($all))
{
	$sina = $all['sina'];
	if (isset($sina))
	{
		sina_add_weibo($sina['token_1st'], $_REQUEST['content']);
	}
	
	$tencent = $all['tencent'];
	if (isset($tencent))
	{
		tencent_add_weibo($tencent['token_1st'], $tencent['token_2nd'], $_REQUEST['content']);
	}
	
	$sohu = $all['sohu'];
	if (isset($sohu))
	{
		$ret = sohu_add_weibo($sohu['token_1st'], $sohu['token_2nd'], $_REQUEST['content']);
	}
	
	$netease = $all['netease'];
	if (isset($netease))
	{
		netease_add_weibo($netease['token_1st'], $netease['token_2nd'], $_REQUEST['content']);
	}
}

header('Location:' . $_SERVER['HTTP_REFERER']);
?>